package com.tedu.dao.repository.Impl;


import com.tedu.dao.mapper.CommentMapper;
import com.tedu.dao.repository.ICommentRepository;

import com.tedu.pojo.entity.Comment;
import com.tedu.pojo.param.CommentParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class CommentRepositoryImpl implements ICommentRepository {
    @Autowired
    private CommentMapper commentMapper;

    @Override
    public int addComment(Comment comment) {
        commentMapper.addComment(comment);
        return 0;
    }

    @Override
    public int deleteComment(Integer id) {
        commentMapper.deleteComment(id);
        return 0;
    }

    @Override
    public int UpdateComment(Comment comment) {
        commentMapper.UpdateComment(comment);
        return 0;
    }

    @Override
    public List<Comment> selectAllComment() {
        return commentMapper.selectAllComment();
    }

    @Override
    public CommentParam selectOne(Integer id) {
        return commentMapper.selectOne(id);
    }
}